//app.js
var util = require('./utils/util');
App({
  onLaunch: function () {
    // 展示本地存储能力
  
  },
  // 验证是否登陆
  checkLogin: function (callback) {
    var that = this;
    util.showLoading();
    if (wx.getStorageSync('dis_id') != '') {
      if (typeof callback == 'function') {
        util.hideLoading();
        callback();
      }
    } else {
      util.hideLoading();
      wx.removeStorageSync('dis_id');
      util.message('您未登录,请先登录', function () {
        var pages = getCurrentPages()
       console.log(pages);
        var back_url = pages[pages.length - 1].route;
         console.log(back_url);
        wx.redirectTo({
          url: '/pages/login/login?back_url=' + back_url,
        })
      })
      return false;
    }
  },
  globalData: {
    userInfo: null,
	  http_url: "https://www.tglq.top/index.php/",
  }
})